﻿@{
    Layout = "~/Views/Generic/_CodebehindLanguageSelector.cshtml";
}

@section cs_webforms
{using System;
using System.Collections.Generic;

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Krystalware.SlickUpload;
using Krystalware.SlickUpload.Web.Controls;

namespace @ViewBag.Project.Name
{
    public partial class @(ViewBag.Sample.Path)Default : System.Web.UI.Page
    {
        protected void slickUpload_UploadComplete(object sender, UploadSessionEventArgs e)
        {
            uploadResult.Text = "Upload Result: " + e.UploadSession.State.ToString();

            if (e.UploadSession.State == UploadState.Error)
                uploadResult.Text += "<br /><br /> Message: " + e.UploadSession.ErrorSummary;

            if (e.UploadSession.State == UploadState.Complete) 
            {
                uploadFileList.DataSource = e.UploadSession.UploadedFiles; 
                uploadFileList.DataBind(); 
            }
        }
    }
}
}
@section vb_webforms {Imports Krystalware.SlickUpload
Imports Krystalware.SlickUpload.Web.Controls

Public Class @(ViewBag.Sample.Path)Default
    Inherits System.Web.UI.Page

    Protected Sub slickUpload_UploadComplete(ByVal sender As Object, ByVal e As UploadSessionEventArgs) Handles slickUpload.UploadComplete
        uploadResult.Text = "Upload Result: " + e.UploadSession.State.ToString() 

        If e.UploadSession.State = UploadState.Error Then 
            uploadResult.Text += "<br /><br /> Message: " + e.UploadSession.ErrorSummary
        End If 

        If e.UploadSession.State = UploadState.Complete Then 
            uploadFileList.DataSource = e.UploadSession.UploadedFiles 
            uploadFileList.DataBind() 
        End If
    End Sub
End Class
}
@section cs_mvc {using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Krystalware.SlickUpload;

namespace @(ViewBag.Project.Name).Controllers
{
    public class HomeController : Controller
    {
        public ActionResult Index(UploadSession session)
        {
            return View(session);
        }
    }
}
}
@section vb_mvc {Imports Krystalware.SlickUpload

Public Class HomeController
    Inherits System.Web.Mvc.Controller

    Public Function Index(session As UploadSession) As ActionResult
        Return View(session)
    End Function
End Class
}